package cn.flying.cloud.task.entity;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.Version;

/**
 * <p>
 * 定时任务执行日志
 * </p>
 *
 * @author admin
 * @since 2025-03-17 00:07:15
 */
@TableName("task_job_log")
public class TaskJobLog implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    /**
     * 流水号
     */
    @TableField("serial_no")
    private String serialNo;

    /**
     * 所属服务
     */
    @TableField("service_name")
    private String serviceName;

    /**
     * 任务日期/批量日期
     */
    @TableField("job_date")
    private LocalDate jobDate;

    /**
     * 任务名称
     */
    @TableField("job_name")
    private String jobName;

    /**
     * 任务类型  DEFAULT定时任务 BATCH批量任务
     */
    @TableField("job_type")
    private String jobType;

    /**
     * 任务分组
     */
    @TableField("job_group")
    private String jobGroup;

    /**
     * 任务描述
     */
    @TableField("job_desc")
    private String jobDesc;

    /**
     * 任务参数
     */
    @TableField("job_param")
    private String jobParam;

    /**
     * 执行实例
     */
    @TableField("job_inst_id")
    private String jobInstId;

    /**
     * 执行主机
     */
    @TableField("job_host")
    private String jobHost;

    /**
     * 执行状态 RUNNING正在执行 SUCCESS执行成功 FAIL执行失败
     */
    @TableField("job_status")
    private String jobStatus;

    /**
     * 耗时
     */
    @TableField("duration")
    private Long duration;

    /**
     * 描述信息
     */
    @TableField("job_msg")
    private String jobMsg;

    /**
     * 异常栈信息
     */
    @TableField("job_trace")
    private String jobTrace;

    /**
     * 开始时间
     */
    @TableField("start_time")
    private LocalDateTime startTime;

    /**
     * 执行时间
     */
    @TableField("fire_time")
    private LocalDateTime fireTime;

    /**
     * 结束时间
     */
    @TableField("end_time")
    private LocalDateTime endTime;

    /**
     * 创建人
     */
    @TableField(value = "created_by", fill = FieldFill.INSERT)
    private String createdBy;

    /**
     * 创建时间
     */
    @TableField(value = "created_time", fill = FieldFill.INSERT)
    private LocalDateTime createdTime;

    /**
     * 修改人
     */
    @TableField(value = "updated_by", fill = FieldFill.INSERT_UPDATE)
    private String updatedBy;

    /**
     * 修改时间
     */
    @TableField(value = "updated_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updatedTime;

    /**
     * 租户ID
     */
    @TableField(value = "tenant_id", fill = FieldFill.INSERT)
    private String tenantId;

    /**
     * 乐观锁版本号
     */
    @TableField(value = "revision", fill = FieldFill.INSERT)
    @Version
    private Long revision;

    /**
     * 删除状态  0 正常-1删除
     */
    @TableField(value = "deleted", fill = FieldFill.INSERT)
    @TableLogic
    private String deleted;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getSerialNo() {
        return serialNo;
    }

    public void setSerialNo(String serialNo) {
        this.serialNo = serialNo;
    }

    public String getServiceName() {
        return serviceName;
    }

    public void setServiceName(String serviceName) {
        this.serviceName = serviceName;
    }

    public LocalDate getJobDate() {
        return jobDate;
    }

    public void setJobDate(LocalDate jobDate) {
        this.jobDate = jobDate;
    }

    public String getJobName() {
        return jobName;
    }

    public void setJobName(String jobName) {
        this.jobName = jobName;
    }

    public String getJobType() {
        return jobType;
    }

    public void setJobType(String jobType) {
        this.jobType = jobType;
    }

    public String getJobGroup() {
        return jobGroup;
    }

    public void setJobGroup(String jobGroup) {
        this.jobGroup = jobGroup;
    }

    public String getJobDesc() {
        return jobDesc;
    }

    public void setJobDesc(String jobDesc) {
        this.jobDesc = jobDesc;
    }

    public String getJobParam() {
        return jobParam;
    }

    public void setJobParam(String jobParam) {
        this.jobParam = jobParam;
    }

    public String getJobInstId() {
        return jobInstId;
    }

    public void setJobInstId(String jobInstId) {
        this.jobInstId = jobInstId;
    }

    public String getJobHost() {
        return jobHost;
    }

    public void setJobHost(String jobHost) {
        this.jobHost = jobHost;
    }

    public String getJobStatus() {
        return jobStatus;
    }

    public void setJobStatus(String jobStatus) {
        this.jobStatus = jobStatus;
    }

    public Long getDuration() {
        return duration;
    }

    public void setDuration(Long duration) {
        this.duration = duration;
    }

    public String getJobMsg() {
        return jobMsg;
    }

    public void setJobMsg(String jobMsg) {
        this.jobMsg = jobMsg;
    }

    public String getJobTrace() {
        return jobTrace;
    }

    public void setJobTrace(String jobTrace) {
        this.jobTrace = jobTrace;
    }

    public LocalDateTime getStartTime() {
        return startTime;
    }

    public void setStartTime(LocalDateTime startTime) {
        this.startTime = startTime;
    }

    public LocalDateTime getFireTime() {
        return fireTime;
    }

    public void setFireTime(LocalDateTime fireTime) {
        this.fireTime = fireTime;
    }

    public LocalDateTime getEndTime() {
        return endTime;
    }

    public void setEndTime(LocalDateTime endTime) {
        this.endTime = endTime;
    }

    public String getCreatedBy() {
        return createdBy;
    }

    public void setCreatedBy(String createdBy) {
        this.createdBy = createdBy;
    }

    public LocalDateTime getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(LocalDateTime createdTime) {
        this.createdTime = createdTime;
    }

    public String getUpdatedBy() {
        return updatedBy;
    }

    public void setUpdatedBy(String updatedBy) {
        this.updatedBy = updatedBy;
    }

    public LocalDateTime getUpdatedTime() {
        return updatedTime;
    }

    public void setUpdatedTime(LocalDateTime updatedTime) {
        this.updatedTime = updatedTime;
    }

    public String getTenantId() {
        return tenantId;
    }

    public void setTenantId(String tenantId) {
        this.tenantId = tenantId;
    }

    public Long getRevision() {
        return revision;
    }

    public void setRevision(Long revision) {
        this.revision = revision;
    }

    public String getDeleted() {
        return deleted;
    }

    public void setDeleted(String deleted) {
        this.deleted = deleted;
    }

    @Override
    public String toString() {
        return "TaskJobLog{" +
                "id = " + id +
                ", serialNo = " + serialNo +
                ", serviceName = " + serviceName +
                ", jobDate = " + jobDate +
                ", jobName = " + jobName +
                ", jobType = " + jobType +
                ", jobGroup = " + jobGroup +
                ", jobDesc = " + jobDesc +
                ", jobParam = " + jobParam +
                ", jobInstId = " + jobInstId +
                ", jobHost = " + jobHost +
                ", jobStatus = " + jobStatus +
                ", duration = " + duration +
                ", jobMsg = " + jobMsg +
                ", jobTrace = " + jobTrace +
                ", startTime = " + startTime +
                ", fireTime = " + fireTime +
                ", endTime = " + endTime +
                ", createdBy = " + createdBy +
                ", createdTime = " + createdTime +
                ", updatedBy = " + updatedBy +
                ", updatedTime = " + updatedTime +
                ", tenantId = " + tenantId +
                ", revision = " + revision +
                ", deleted = " + deleted +
                "}";
    }
}
